package cj.web.kly.utils;

import java.io.IOException;
import java.util.HashMap;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.web.context.WebApplicationContext;
import org.springframework.web.context.support.WebApplicationContextUtils;
public class MainServlet extends HttpServlet {
    /** 
     * Initialization of the servlet. <br> 
     *  
     * @throws ServletException 
     *             if an error occurs 
     */  
    private static final long serialVersionUID = 1L;  
    // private SystemParamServicesImpl sysParamService;  
    private static WebApplicationContext springContext;  
    private ServletContext context;  
    public void init() throws ServletException {  
        // Put your code here  
          
        springContext = WebApplicationContextUtils  
                .getWebApplicationContext(this.getServletContext());  
        GetDictionaryInfo._servletContext=this.getServletContext();  
          
        context = this.getServletContext();  
        // GetDictionaryInfo getDictionaryInfo = new GetDictionaryInfo();  
        HashMap<String, Object> dictionaryInfoMap = (HashMap<String, Object>) GetDictionaryInfo.dictionaryInfoMap;  
        System.out.println("字典MAP里的数据长度为" + dictionaryInfoMap.size() + "个");  
        context.setAttribute("dictionaryInfoMap", dictionaryInfoMap);  
        System.out.println("@@@@@@@@@@系统字典表数据加载成功！");  
    }  
    /** 
     * Constructor of the object. 
     */  
    public MainServlet() {  
        super();  
    }  
    /** 
     * Destruction of the servlet. <br> 
     */  
    public void destroy() {  
        super.destroy(); // Just puts "destroy" string in log  
        // Put your code here  
    }  
    
    public void doGet(HttpServletRequest request, HttpServletResponse response)  
            throws ServletException, IOException {  
        
    }  
    
    public void doPost(HttpServletRequest request, HttpServletResponse response)  
            throws ServletException, IOException {  
        
    }  
}  